﻿using System;
using System.Windows.Data;
using AccessControl.Wpf.Settings.ViewModels;

namespace AccessControl.Wpf.Converters
{
	class SettingsStateToBoolConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			SettingsState state = (SettingsState)value;
			SettingsState comp = (SettingsState)Enum.Parse(typeof(SettingsState), parameter as string);

			return state == comp;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			return null;
		}

		#endregion
	}
}
